package hu.issue.common;

public class EnumUtil {

	private enum E {
		A, B, C
	}

	public static <T extends Enum<T>> T valueOfIgnoreCase(final Class<T> enumType, final String name) {

		final T[] values = enumType.getEnumConstants();
		for (final T value : values) {
			if (value.toString().equalsIgnoreCase(name)) {
				return value;
			}
		}
		throw new IllegalArgumentException("No enum const " + enumType + "." + name + " (ignore case)");
	}
}
